/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author frico
 */
@Entity
@Table(name = "ALMACEN")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Almacen.findAll", query = "SELECT a FROM Almacen a"),
    @NamedQuery(name = "Almacen.findByFcodigo", query = "SELECT a FROM Almacen a WHERE a.fcodigo = :fcodigo"),
    @NamedQuery(name = "Almacen.findByFdescripcion", query = "SELECT a FROM Almacen a WHERE a.fdescripcion = :fdescripcion"),
    @NamedQuery(name = "Almacen.findByFdescripcionresumida", query = "SELECT a FROM Almacen a WHERE a.fdescripcionresumida = :fdescripcionresumida"),
    @NamedQuery(name = "Almacen.findByFcomercial", query = "SELECT a FROM Almacen a WHERE a.fcomercial = :fcomercial"),
    @NamedQuery(name = "Almacen.findByFpuntopedido", query = "SELECT a FROM Almacen a WHERE a.fpuntopedido = :fpuntopedido"),
    @NamedQuery(name = "Almacen.findByFsucursal", query = "SELECT a FROM Almacen a WHERE a.fsucursal = :fsucursal"),
    @NamedQuery(name = "Almacen.findByFdefecto", query = "SELECT a FROM Almacen a WHERE a.fdefecto = :fdefecto"),
    @NamedQuery(name = "Almacen.findByFsector", query = "SELECT a FROM Almacen a WHERE a.fsector = :fsector"),
    @NamedQuery(name = "Almacen.findByFtipostock", query = "SELECT a FROM Almacen a WHERE a.ftipostock = :ftipostock"),
    @NamedQuery(name = "Almacen.findByFtipostockcuenta", query = "SELECT a FROM Almacen a WHERE a.ftipostockcuenta = :ftipostockcuenta"),
    @NamedQuery(name = "Almacen.findByFidnum", query = "SELECT a FROM Almacen a WHERE a.fidnum = :fidnum")})
public class Almacen implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "FCODIGO")
    private String fcodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "FDESCRIPCION")
    private String fdescripcion;
    @Size(max = 20)
    @Column(name = "FDESCRIPCIONRESUMIDA")
    private String fdescripcionresumida;
    @Column(name = "FCOMERCIAL")
    private Boolean fcomercial;
    @Column(name = "FPUNTOPEDIDO")
    private Boolean fpuntopedido;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "FSUCURSAL")
    private String fsucursal;
    @Column(name = "FDEFECTO")
    private Boolean fdefecto;
    @Size(max = 16)
    @Column(name = "FSECTOR")
    private String fsector;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 24)
    @Column(name = "FTIPOSTOCK")
    private String ftipostock;
    @Size(max = 16)
    @Column(name = "FTIPOSTOCKCUENTA")
    private String ftipostockcuenta;
    @Size(max = 16)
    @Column(name = "FIDNUM")
    private String fidnum;

    public Almacen() {
    }

    public Almacen(String fcodigo) {
        this.fcodigo = fcodigo;
    }

    public Almacen(String fcodigo, String fdescripcion, String fsucursal, String ftipostock) {
        this.fcodigo = fcodigo;
        this.fdescripcion = fdescripcion;
        this.fsucursal = fsucursal;
        this.ftipostock = ftipostock;
    }

    public String getFcodigo() {
        return fcodigo;
    }

    public void setFcodigo(String fcodigo) {
        this.fcodigo = fcodigo;
    }

    public String getFdescripcion() {
        return fdescripcion;
    }

    public void setFdescripcion(String fdescripcion) {
        this.fdescripcion = fdescripcion;
    }

    public String getFdescripcionresumida() {
        return fdescripcionresumida;
    }

    public void setFdescripcionresumida(String fdescripcionresumida) {
        this.fdescripcionresumida = fdescripcionresumida;
    }

    public Boolean getFcomercial() {
        return fcomercial;
    }

    public void setFcomercial(Boolean fcomercial) {
        this.fcomercial = fcomercial;
    }

    public Boolean getFpuntopedido() {
        return fpuntopedido;
    }

    public void setFpuntopedido(Boolean fpuntopedido) {
        this.fpuntopedido = fpuntopedido;
    }

    public String getFsucursal() {
        return fsucursal;
    }

    public void setFsucursal(String fsucursal) {
        this.fsucursal = fsucursal;
    }

    public Boolean getFdefecto() {
        return fdefecto;
    }

    public void setFdefecto(Boolean fdefecto) {
        this.fdefecto = fdefecto;
    }

    public String getFsector() {
        return fsector;
    }

    public void setFsector(String fsector) {
        this.fsector = fsector;
    }

    public String getFtipostock() {
        return ftipostock;
    }

    public void setFtipostock(String ftipostock) {
        this.ftipostock = ftipostock;
    }

    public String getFtipostockcuenta() {
        return ftipostockcuenta;
    }

    public void setFtipostockcuenta(String ftipostockcuenta) {
        this.ftipostockcuenta = ftipostockcuenta;
    }

    public String getFidnum() {
        return fidnum;
    }

    public void setFidnum(String fidnum) {
        this.fidnum = fidnum;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fcodigo != null ? fcodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Almacen)) {
            return false;
        }
        Almacen other = (Almacen) object;
        if ((this.fcodigo == null && other.fcodigo != null) || (this.fcodigo != null && !this.fcodigo.equals(other.fcodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Almacen[ fcodigo=" + fcodigo + " ]";
    }
    
}
